package x.amadeus.announcement.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import x.amadeus.announcement.domain.Announcement;
import x.amadeus.announcement.domain.Message;
import x.amadeus.announcement.mapper.AnnouncementMapper;

@Service
@Transactional
public class AnnouncementService {
	
	@Resource(name="announcementMapper")
	private AnnouncementMapper announcementMapper;

	public List<Announcement> findAll() {
		return announcementMapper.findAll();
	}

	public Announcement findByAid(String aid) {
		return announcementMapper.findByAid(aid);
	}

	public void add(Announcement announcement) {
		announcementMapper.add(announcement);
	}

	public void edit(Announcement announcement) {
		announcementMapper.edit(announcement);
	}

	public void delete(String aid) {
		announcementMapper.delete(aid);
	}
	
	public void addM(Message msg)
	{
		announcementMapper.addM(msg);
	}
	
	public List<Message> findAllM()
	{
		return announcementMapper.findAllM();
	}
}
